/**
 * @param {string} s
 * @return {boolean}
 */
var isPalindrome = function (s) {
    s = s.replaceAll(/[^a-zA-Z0-9]/g, "").toLowerCase();
    for (let left = 0, right = s.length - 1; left < right; ++left, --right) {
        if (s[left] !== s[right]) {
            return false;
        }
    }
    return true;
};
console.log(isPalindrome("A man, a plan, a canal: Panama"));